<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
		<link href="../css/bgcss.css"
			rel="stylesheet" type="text/css" />
			<script type="text/javascript">
		function isDel(id){
			 if(!confirm('真的要删除吗？')){    
      			 return;    
 		 	 }
 		 	 else{
 		 	 var id=id;
 		 	 	location.href="<%=request.getContextPath()%>/background/admin?action=delete&admin_id="+id;
 		 	 }
		}
	</script>
	</head>

	<body>
		<jsp:include page="../frame/right_top.jsp" flush="true" />
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td>
								&nbsp;
							</td>
							<td style="padding-right: 10px;">
								<div align="right">
									<table border="0" align="right" cellpadding="0" cellspacing="0">
										<tr>
											<td width="60">
												<table width="87%" border="0" cellpadding="0"
													cellspacing="0">
													<tr>
													</tr>
												</table>
											</td>
											<td width="60">
												<table width="90%" border="0" cellpadding="0"
													cellspacing="0">
													<tr>
													</tr>
												</table>
											</td>
											<td width="60">
												<table width="90%" border="0" cellpadding="0"
													cellspacing="0">
													<tr>
													</tr>
												</table>
											</td>
											<td width="52">
												<table width="88%" border="0" cellpadding="0"
													cellspacing="0">
													<tr>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
			<td>
			<!-- 正文开始 -->
				<table width="60%" border="0" cellpadding="0" cellspacing="1"
						bgcolor="#c9c9c9">	
						<tr>					
				<td height="22" bgcolor="#FFFFFF">
					<div align="center">
						<strong><span class="STYLE1">用户编号</span>
						</strong>
					</div>
				</td>
				<td height="22" bgcolor="#FFFFFF">
					<div align="center">
						<strong><span class="STYLE1">用户帐号</span>
						</strong>
					</div>
				</td>
				<td height="22" bgcolor="#FFFFFF">
					<div align="center">
						<strong><span class="STYLE1">用户昵称</span>
						</strong>
					</div>
				</td>		
				<td height="22" bgcolor="#FFFFFF">
					<div align="center">
						<strong><span class="STYLE1">操作</span>
						</strong>
					</div>								
				
							</td>							
						</tr>
						<!-- 分页循环开始 -->
				<c:forEach items="${pb.datas}" var="item" varStatus="var">
							<tr>					
				 <td height="22" bgcolor="#FFFFFF">
				 <div align="center"><span class="STYLE3">${item.admin_id }</span>
					</div>
				</td>
				 <td height="22" bgcolor="#FFFFFF"><div align="center"><span class="STYLE3">${item.admin_login_name}</span>
						
					</div>
				</td>
				 <td height="22" bgcolor="#FFFFFF"><div align="center"><span class="STYLE3">${item.admin_nick_name }</span>
						
					</div>
				</td>		
				 <td height="22" bgcolor="#FFFFFF"><div align="center"><span class="STYLE3">
				<input type="button" value="修改" onclick="javascript:location.href='<%=request.getContextPath()%>/background/admin?action=updateForward&admin_id=${item.admin_id }'"/>
				
				
				<input type="button" value="删除" onclick="isDel(${item.admin_id })" />
				</span>
					
					</div>								
				
							</td>							
						</tr>
						</c:forEach>
						<!-- 分页循环结束 -->					
					</table>
				<!-- 正文结束 -->	
				
		<c:if test="${pb.totalPages>1}">
		
			<div class="pager">

				<span id="pageNums"> <c:if test="${1==num}">首页</c:if> <c:if
						test="${1<num}">
						<a
							href="<%=request.getContextPath()%>/background/admin?action=findAll&page=1">首页
						</a>
					</c:if> <c:if test="${pb.beginPage==num||pb==null}">上一页</c:if> <c:if
						test="${pb!=null&&pb.beginPage!=num}">
						<a
							href="<%=request.getContextPath()%>/background/admin?action=findAll&page=${num-1 }">上一页
						</a>
					</c:if> <c:forEach begin="${pb.beginPage}"
						end="${pb.beginPage+pb.pageStep}" var="num">

						<c:choose>
							<c:when test="${pb==null||pb.pageNum==num}">
								<span>${num }</span>
							</c:when>
							<c:otherwise>
								<a
									href="<%=request.getContextPath()%>/background/admin?action=findAll&page=${num}">${num
									} </a>
							</c:otherwise>
						</c:choose>
					</c:forEach> <c:if test="${pb.totalPages==pb.pageNum||pb==null}">下一页</c:if> <c:if
						test="${pb!=null&&pb.totalPages!=pb.pageNum}">
						<a
							href="<%=request.getContextPath()%>/background/admin?action=findAll&page=${num+1 }">下一页
						</a>
					</c:if> <c:if test="${pb==null||pb.totalPages==num}">尾页</c:if> <c:if
						test="${pb!=null&&pb.totalPages!=num}">
						<a
							href="<%=request.getContextPath()%>/background/admin?action=findAll&page=${pb.totalPages}">尾页
						</a>
					</c:if> </span>

			</div>
		</c:if>
		</td>
			</tr>
		</table>
	</body>
</html>
